import java.util.*;
public class Task{
    public static void main(String[] args){
        List<String> l = new LinkedList<>();
        l.add("ab");
        l.add("ac");
        l.add("ad");
        Iterator<String> it = l.iterator();
        while(it.hasNext()){
            String s = it.next();
            if("ab".equals(s)){
                it.remove();
            }else{
                System.out.println(s.toUpperCase());
            }
        }
    }
}